home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 November / 1992-11.d64 / mob demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  8KB  |  224 lines

  1. 10 rem copyright 1992 - compute publications intl ltd - all rights reserved
  2. 20 :
  3. 30 :
  4. 40 sa = 32000
  5. 50 if peek(776)=32 and peek(777)=131 then90
  6. 60 f$ = "mob master":gosub2210
  7. 70 f$ = "sprites":gosub2210
  8. 80 poke sa+1528,96: sys sa: poke sa+1528,169
  9. 90 bd= 53280:ba= 53281:cc= 646:xr= 781:yr= 782:pl= 58636:ms= 13568
  10. 100 se= sa+1329:ag= 32/45
  11. 110 poke 650,128:print chr$(14) chr$(8)"[154][147]"
  12. 120 poke bd,6:poke ba,6:/zap:/split 0
  13. 130 gosub1960:gosub1990
  14. 140 y=4:d=192:s=62:poke cc,15:m$="[175][175][175][175][175][175][175][175][175][175][175][175][175][175]":gosub1760
  15. 150 poke cc,12:poke 199,1:m$="  [205][207][194] [205][193][211][212][197][210]  ":gosub1760
  16. 160 poke cc,11:poke 199,0:m$="[183][183][183][183][183][183][183][183][183][183][183][183][183][183]":gosub1760
  17. 170 y=y+1:poke cc,7:m$="[195]opyright 1992 [195][207][205][208][213][212][197] [208]ubls [201]ntl [204]td":gosub1760
  18. 180 y=y+1:poke cc,1:m$="   [215]elcome to [205][207][194] [205]aster, the versatile":gosub1810
  19. 190 m$="and powerful sprite controller for your":gosub1810
  20. 200 m$="[195]ommodore 64!  [205][207][194] [205]aster adds 10 new":gosub1810
  21. 210 m$="[194][193][211][201][195] commands for easier sprite":gosub1810
  22. 220 m$="definition, positioning, movement,":gosub1810
  23. 230 m$="animation, and other miscellaneous":gosub1810
  24. 240 m$="functions.  [217]ou can even do all of this":gosub1810
  25. 250 m$="without a single poke statement!":gosub1810
  26. 260 y=y+1:poke cc,14:m$="[208][204][197][193][211][197] [208][210][197][211][211] [193] [203][197][217] [212][207] [195][207][206][212][201][206][213][197]":gosub1760
  27. 270 poke 198,0
  28. 280 get a$:if a$<>"" then300
  29. 290 gosub1920:goto280
  30. 300 poke ba,0:poke bd,0:/zap
  31. 310 print"[147]   [212]he '[211][208][210][201][212][197]' command defines most"
  32. 320 print"of the characteristics of a sprite."
  33. 330 print"[215]ith the '[211][208][210][201][212][197]' command, you can do"
  34. 340 print"the following to a sprite:"
  35. 350 dl=2000:gosub2130
  36. 360 print:print"[155] * turn it on or off"
  37. 370 /sprite 0,1,1,0,0,0:/animate 0,255,0,202
  38. 380 /movspr 0,160,140
  39. 390 dl=500:fori=1to5
  40. 400 /sprite 0,1:gosub2130
  41. 410 /sprite 0,0:gosub2130
  42. 420 next
  43. 430 /sprite 0,1
  44. 440 print:print" * set its foreground color"
  45. 450 print"   (16 different colors in total)"
  46. 460 fori=0to15
  47. 470 /sprite 0,*,i:forz=1to200:next
  48. 480 next:/sprite 0,*,1
  49. 490 print:print" * set its priority to the background"
  50. 500 m$="[219][219][219][219][219]":gosub2100
  51. 510 fori=1to5
  52. 520 /sprite 0,*,*,1:gosub2130
  53. 530 /sprite 0,*,*,0:gosub2130
  54. 540 next:m$="     ":gosub2100
  55. 550 print"[155] * expand it to twice its original size"
  56. 560 print"   horizontally, vertically, or both"
  57. 570 /sprite 0,*,*,*,1:dl=1000:gosub2130
  58. 580 /sprite 0,*,*,*,0,1:gosub2130
  59. 590 /sprite 0,*,*,*,1,1:gosub2130
  60. 600 /sprite 0,*,*,*,0,0
  61. 610 print:print" * the sprite can display up to 3"
  62. 620 print"   different colors at a time by turning";
  63. 630 print"   on multicolor mode."
  64. 640 fori=1to5
  65. 650 /animate 0,*,*,203:/sprcolor 10,6:/sprite 0,*,*,*,*,*,1:gosub2130
  66. 660 /animate 0,*,*,202:/sprite 0,*,*,*,*,*,0:gosub2130
  67. 670 next
  68. 680 print:print"[217]ou can define and use up to eight"
  69. 690 print"sprites at a time.[158]"
  70. 700 z=1:fori=0to7
  71. 710 ifz=1thenz=0:/animate i,*,*,202:goto730
  72. 720 z=1:/animate i,*,*,203
  73. 730 /sprite i,1,i+1,0,0,0,z:next
  74. 740 z=0:fori=0to320step38
  75. 750 /movspr z,i,140:z=z+1:next
  76. 760 y=24:gosub2140
  77. 770 /zap:print"[147]   [211]prite animation is easy with [205][207][194]"
  78. 780 print"[205]aster.  [212]he '[193][206][201][205][193][212][197]' command takes"
  79. 790 print"care of animation in [194][193][211][201][195]."
  80. 800 /sprite 0,1,1,0,0,0,1:/sprcolor 2,6:/animate 0,4,0,204,207
  81. 810 /movspr 0,160,148:dl= 2000:gosub2130
  82. 820 print:print"[155]   [212]he animation speed can be changed"
  83. 830 print"for faster or slower animation.  [212]he"
  84. 840 print"sprite can animate very fast[155]...";
  85. 850 /animate 0,0:dl=5000:gosub2130
  86. 860 print"[157][157][157] or very":print"slowly[155]."
  87. 870 /animate 0,64:dl=5000:gosub2130
  88. 880 print:print"   [212]he sprite can be animated always"
  89. 890 print"or just once.[158]":/animate 0,*,1
  90. 900 y=12:gosub2140
  91. 910 /zap:poke ba,6:pokebd,6:y=9:x=0:gosub2090
  92. 920 print"   [217]ou can place the sprite anywhere"
  93. 930 print"on the screen by using the '[159][205][207][214][211][208][210]'"
  94. 940 print"command.  [217]ou can also move the sprite"
  95. 950 print"using the same command.  [194]est of all,"
  96. 960 print"the sprites continue to move and"
  97. 970 print"animate while your program does"
  98. 980 print"something else![154]"
  99. 990 dl=1000:gosub2130
  100. 1000 /sprcolor 0,7
  101. 1010 y=54:fori=0to7:c=i:if i=6 thenc=15
  102. 1020 /sprite i,1,c,0,0,0,1:/animate i,4,0,208,210:/boundary i,0,0,255,0,344
  103. 1030 /movspr i,0,y:y=y+25:next
  104. 1040 fori=0to7:/movspr i,64#63-i:next
  105. 1050 y=17:gosub2140
  106. 1060 /zap:poke bd,0:poke ba,0
  107. 1070 x=0:y=6:gosub2090
  108. 1080 /sprcolor 9,0:/sprite 0,1,1,0,0,0,1:/animate 0,4,0,204,207
  109. 1090 /boundary 0,3,1,254,1,344
  110. 1100 print"   [212]he direction of the sprite can also"
  111. 1110 print"be determined by the '[205][207][214][211][208][210]' command."
  112. 1120 x=0:y=9:gosub2090
  113. 1130 /movspr 0,160,148:/movspr 0,*#255:/sprite 0,1
  114. 1140 print"[155][197]nter the direction of the sprite in"
  115. 1150 print"degrees; enter [158]-1[155] to go on";:inputa
  116. 1160 ifa<0then1210
  117. 1170 a=a*ag:ifa>360then1120
  118. 1180 /movspr 0,a#64
  119. 1190 if peek(se)and1 then1190
  120. 1200 goto1120
  121. 1210 print"[147]":y=3:x=0:gosub2090:poke bd,11:/sprcolor 9
  122. 1220 print"   [197]ach sprite has its own individual"
  123. 1230 print"boundary.  [217]ou can use the '[194][207][213][206][196][193][210][217]'"
  124. 1240 print"command to define the sprite's boundary"
  125. 1250 print"and its action at a boundary."
  126. 1260 print:print"[155]   [193]t the boundary, the sprite will do"
  127. 1270 print"one of the following action:"
  128. 1280 dl=3000:gosub2130
  129. 1290 print:print" * wrap around"
  130. 1300 b=0:x1=0:x2=250:x3=0:x4=344:gosub2170
  131. 1310 print:print" * bounce off the boundary"
  132. 1320 b=1:x1=46:x2=231:x3=24:x4=320:gosub2170
  133. 1330 print:print" * stop at the boundary"
  134. 1340 b=2:gosub2170
  135. 1350 print:print" * disable at the boundary"
  136. 1360 b=3:gosub2170
  137. 1370 y=19:gosub2140
  138. 1380 /zap:x=0:y=10:gosub2090
  139. 1390 poke 16383,0:poke bd,6:poke ba,6:poke 53265,11
  140. 1400 print"   [217]ou can even display sprites on the"
  141. 1410 print"top and bottom border!  [212]he '[159][211][208][204][201][212]'"
  142. 1420 print"command lets you choose between the two"
  143. 1430 print"split-screen modes.[154]"
  144. 1440 /irq 0:fori=0to3:/sprite i,1,7,0,0,0,1:/boundary i,0,0,250,0,344:next
  145. 1460 /animate 0,4,0,192,193:/animate 1,0,0,194,195:/sprcolor 0,1
  146. 1470 /movspr 0,0,38:/movspr 1,24,38
  147. 1480 /animate 2,0,0,198,199:/animate 3,4,0,196,197
  148. 1490 /movspr 2,320,242:/movspr 3,344,242
  149. 1500 fori=4to7:/sprite i,1,15,0,0,0,1:/boundary i,0,0,250,0,344:next
  150. 1510 /animate 4,0,255,200:/animate 5,0,255,201
  151. 1520 /animate 6,0,255,200:/animate 7,0,255,201
  152. 1530 /movspr 4,0,35:/movspr 5,24,35:/movspr 6,0,245:/movspr 7,24,245
  153. 1540 /movspr 4,64#64:/movspr 5,64#64:/movspr 6,64#63:/movspr 7,64#63
  154. 1550 /movspr 0,64#63:/movspr 1,64#63
  155. 1560 /movspr 3,192#63:/movspr 2,192#63
  156. 1570 /irq 1:/split1:poke 53265,27
  157. 1580 dl=2000:gosub2130:y=15:gosub2140
  158. 1590 /zap:/split0:poke 53265,27
  159. 1600 gosub1960:gosub1990
  160. 1610 y=8:d=192:s=62:poke cc,1
  161. 1620 m$="   [193]s you can see, there are endless":gosub1810
  162. 1630 m$="uses for [205][207][194] [205]aster.  [217]ou can use [205][207][194]":gosub1810
  163. 1640 m$="[205]aster to write a good quality arcade":gosub1810
  164. 1650 m$="game in either [194][193][211][201][195] or machine":gosub1810
  165. 1660 m$="language.  [215]ith [205][207][194] [205]aster, only your":gosub1810
  166. 1670 m$="immagination is the limit!":gosub1810
  167. 1680 y=y+1:poke cc,3:m$="[208]ress the [211][208][193][195][197] [194][193][210] to restart this":gosub1760
  168. 1690 m$="demo; press any other key to quit.":gosub1760
  169. 1700 poke 198,0
  170. 1710 get a$:if a$=" "then run
  171. 1720 if a$<>"" then1740
  172. 1730 gosub1920:goto1710
  173. 1740 /zap:/split:sys 65409:end
  174. 1750 ---- subroutines ----
  175. 1760 gosub1820
  176. 1770 zz=len(m$):z=40-zz:l=z/2:r=l+zz
  177. 1780 /irq 0:/movspr 0,d#s:/movspr 1,d#s:/irq 1
  178. 1790 sys ms,m$,y,l,r,e:y=y+1:return
  179. 1800 ----
  180. 1810 gosub1820:l=0:r=len(m$):goto1780
  181. 1820 z=y*8+42
  182. 1830 if d=192 then1870
  183. 1840 d=192:e=2:gosub1910
  184. 1850 /movspr 0,368,z:/movspr 1,344,z
  185. 1860 /animate 0,4,0,196,197:/an